package com.yejiali.backend.task;

import com.yejiali.backend.mapper.VideosMapper;
import com.yejiali.backend.service.VideoLikesService;
import com.yejiali.backend.service.VideosService;
import com.yejiali.backend.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author:yejiali
 * @Date:2025/8/15-08-15-11:03
 * @Decsription:com.yejiali.backend.task
 * @Version:1.0
 */
@Component
public class UpdateVideoLikedCount {

    @Autowired
    private VideosService videosService;

    @Autowired
    private VideoLikesService videoLikesService;

    @Autowired
    private RedisUtil redisUtil;

    /**
     * 定时任务，每1分钟执行一次
     * 1.遍历视频，查询redis中点赞列表
     * 2.将点赞数更新到视频表中
     * 3.遍历set中每一个userID,将记录插入表中?
     */
    //每1分钟执行一次
    @Scheduled(cron = "0 */1 * * * *")
    public void updateVideoLikedCount() {


    }
}
